import java.util.Scanner;

public class Test2 {
    public static void main1(String[] args) {
        //打印1到100的素数
        for (int a = 2; a < 100; a++) {
            int b = 2;
            for (; b <= Math.sqrt(a); b++) {
                if (a % b == 0) {
                    break;
                }
            }
            if (b > Math.sqrt(a)) {
                System.out.print(a + "是素数 ");
            }
        }
    }

    public static void main2(String[] args) {
        //打印1000到2000的闰年
        for (int year = 1000; year < 2000; year++) {
            if(year % 100 != 0){
                if(year % 4 ==0){
                    System.out.println(year + "是闰年！");
                }
            }
        }
    }

    public static void main(String[] args) {
        //打印1到100出现9的数有几个
        int count = 0;
        for(int a = 1; a <= 100; a++){
            if (a % 10 == 9){
                count++;
            }else if(a / 10 == 9){      //如果问的是出现数字9的个数则删掉else,结果为20
                count++;
            }
        }
        System.out.println(count);
    }

    public static void main4(String[] args) {
        //求两个数的最大公约数
        int a = 20;
        int b = 40;
        int c = a % b;
        while (c != 0){
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(b);
    }

    public static void main5(String[] args) {
        //计算1-1/2+1/3-1/4......+1/99-1/100
        double sum = 0;
        int flg = 1;
        for (int a = 1; a <= 100; a++){
            sum = sum + 1*1.0/a * flg;
            flg = -flg;
        }
        System.out.println(sum);
    }

    public static void main6(String[] args) {
        //打印X形状图
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 10; j++) {
                    if (i == j) {
                        System.out.println("*");
                    } else if (i + j == n - 1) {
                        System.out.println("*");
                    } else {
                        System.out.println(" ");
                    }
                }
                System.out.println();
            }
        }
    }

}